package com.wsh.crawler.entity;

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.List;

@Data
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@Schema(title = "EvtNews", description = "爬虫资讯")
@Document(collection = "evt_news")
public class News {
    @Id
    private String id;

    @Indexed
    @Schema(title = "标题")
    private String title;

    @Schema(title = "内容")
    private String content;

    @Indexed
    @Schema(title = "来源网站")
    private String source; // 来源网站

    @Field("original_url")
    @Schema(title = "原文链接")
    private String originalUrl; // 原文链接

    @Schema(title = "原始封面链接")
    @Field("original_cover_url")
    private String originalCoverUrl;

    @Schema(title = "封面链接")
    @Field("cover_url")
    private String coverUrl;

    @Schema(title = "图片链接列表")
    @Field("image_urls")
    private List<String> imageUrls;

    @Schema(title = "视频链接列表")
    @Field("video_urls")
    private List<String> videoUrls;

    @Schema(title = "发布时间")
    @Field("publish_time")
    private Date publishTime;

    @Schema(title = "爬取时间")
    @Field("crawl_time")
    private Date crawlTime;

    @Schema(title = "用于去重的MD5值")
    @Indexed
    @Field("md5_hash")
    private String md5Hash;

    @Schema(title = "语言") // 枚举类：LanguageEnum
    private String language;

    @Schema(title = "标签列表", description = "暂无")
    private List<String> tags;
}
